package com.newer.his.common.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.newer.his.common.entity.AdviceType;
@Mapper
public interface AdviceTypeMapper {
	
	@Options(useGeneratedKeys = true, 
			keyColumn = "adiveType_id", 
			keyProperty = "id")
	@Insert("insert into advicetype(name,type) values(#{name},#{type})")
	void save(AdviceType adviceType);
	
	@Select("select adiveType_id,name,type from advicetype where adiveType_id=#{id}")
	AdviceType findbyId (int id);
	
	@Select("select adiveType_id,name,type from advicetype")
	List<AdviceType> findAll();
	
	
	@Update("update advicetype set name=#{name}, type=#{type} where adiveType_id=#{id}")
	void update(AdviceType adviceType);
	
	@Delete("delete from advicetype where adiveType_id=#{id}")
	void delete(int id);
	

}
